﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Rarous.TexyNet.Modules
{
    /// <summary>
    /// Třída obsahující informace o konfiguraci modulu citací
    /// </summary>
    public class QuoteModule
    {
        #region Fields
		private bool allowedLine;
        private bool allowedBlock; 
	    #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public QuoteModule()
        {
            allowedBlock = true;
            allowedLine = true;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="element"></param>
        public QuoteModule(Configuration.QuoteModuleElement element) 
            : this()
        {
            ReadConfiguration(element);
        }
        #endregion

        #region Private Methods
        private void ReadConfiguration(Configuration.QuoteModuleElement element)
        {
            if (element == null)
            {
                return;
            }

            allowedBlock = element.AllowedBlock;
            allowedLine = element.AllowedLine;
        } 
        #endregion 

        #region Properties
        /// <summary>
        /// Příznak, zda-li je povolena řádková citace
        /// </summary>
        public bool AllowedLine
        {
            get { return allowedLine; }
            set { allowedLine = value; }
        }

        /// <summary>
        /// Příznak, zda-li je povolena bloková citace
        /// </summary>
        public bool AllowedBlock
        {
            get { return allowedBlock; }
            set { allowedBlock = value; }
        } 
        #endregion
    }
}
